<?php

defined ( 'DS' ) || define ( 'DS', DIRECTORY_SEPARATOR );
defined ( 'PS' ) || define ( 'PS', PATH_SEPARATOR );

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

defined('APPLICATION_LIB')
    || define('APPLICATION_LIB', realpath(dirname(__FILE__) . '/../libraries'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../libraries'),
    get_include_path(),
)));

/* Use for validate */

require_once APPLICATION_PATH . '/configs/Validator.class.php';
require_once APPLICATION_PATH . '/configs/Common.php';
/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()->run();
//$application->getBootstrap()->bootstrap('doctrine');
//
//$cli = new Doctrine_Cli($application->getOption('doctrine'));
//$cli->run($_SERVER['argv']);